<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix'=>'api/wx','namespace'=>'Api'],function(){
    Route::any('event', 'WxEvent@index');
    Route::get('token', 'WxEvent@getToken');
    Route::get('is-bind', 'UserController@isBindWx')->name('wx.is-bind');
    Route::get('is-subscribe', 'UserController@isSubscribeWx')->name('wx.is-subscribe');
});

Route::group(['prefix'=>'api/anchors','namespace'=>'Api'], function () {
    Route::get('{anchor_id}/rec', 'AnchorController@rec')->name('anchors.rec');
    Route::get('{anchor_id}/unrec', 'AnchorController@unrec')->name('anchors.unrec');
});

Route::get('api/sitemap', 'Api\SiteMap@index')->name('sitemap.gen');

Route::get('api/anchors/search', 'AnchorController@search')->name('anchors.search');

Route::get('api/anchors/{anchor_id}/subscribe', 'Api\AnchorController@subscribe');
Route::get('api/anchors/{anchor_id}/unsubscribe', 'Api\AnchorController@unsubscribe');